curl --request PUT \
--url https://api.hyperline.co/v1/subscriptions/templates/{templateId}/configurations/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"currency": "EUR",
"country": null,
"phases": [
{
"activation_strategy": "manual",
"end_strategy": "duration",
"billing_date_setting": "phase_start",
"products": [
{
"id": "itm_FJKlqUb8COXw55",
"name": "Product name",
"description": "A description of the product.",
"description_display_interval_dates": false,
"payment_interval": {
"period": "once"
},
"payment_schedule": "start",
"price": {
"type": "fee",
"amount": 200
},
"prices": [
{
"type": "volume",
"from": 0,
"to": 20,
"amount": 200,
"unit_count": 1,
"on_tier_incomplete": null
},
{
"type": "volume",
"from": 20,
"to": null,
"amount": 150,
"unit_count": 1,
"on_tier_incomplete": null
}
],
"count": 2,
"unit_name": "user",
"min_committed_count": 2,
"min_amount": 123,
"max_amount": 123,
"bill_usage_difference": false,
"credits_expiration_in_days": 123,
"expire_credits_at_end_of_period": false
}
],
"name": "Initial term",
"type": "standard",
"status": "pending",
"order": 0,
"duration": {
"count": 1,
"period": "years"
},
"initial_billing_at": "2024-12-20T16:04:11Z",
"starts_at": "2024-12-20T16:04:11Z",
"ends_at": "2024-12-20T16:04:11Z",
"billing_cycle_alignment": "anniversary",
"do_not_invoice_phase": false,
"transition_calculation_method": "prorata",
"transition_invoicing_schedule": "immediately",
"coupons": [
{
"id": "<string>",
"duration_count": 123,
"expires_at": "2024-12-20T16:04:11Z",
"apply_at": "2024-12-20T16:04:11Z",
"product_ids": [
"<string>"
]
}
]
}
],
"name": "<string>",
"minimum_invoice_fee": 250,
"cancel_at": "2024-12-20T16:04:11Z",
"custom_properties": {},
"generate_document": true,
"document_name": "<string>",
"add_tax_to_document": true,
"generate_draft_invoices": true
}
'import requests
url = "https://api.hyperline.co/v1/subscriptions/templates/{templateId}/configurations/{id}"
payload = {
"currency": "EUR",
"country": None,
"phases": [
{
"activation_strategy": "manual",
"end_strategy": "duration",
"billing_date_setting": "phase_start",
"products": [
{
"id": "itm_FJKlqUb8COXw55",
"name": "Product name",
"description": "A description of the product.",
"description_display_interval_dates": False,
"payment_interval": { "period": "once" },
"payment_schedule": "start",
"price": {
"type": "fee",
"amount": 200
},
"prices": [
{
"type": "volume",
"from": 0,
"to": 20,
"amount": 200,
"unit_count": 1,
"on_tier_incomplete": None
},
{
"type": "volume",
"from": 20,
"to": None,
"amount": 150,
"unit_count": 1,
"on_tier_incomplete": None
}
],
"count": 2,
"unit_name": "user",
"min_committed_count": 2,
"min_amount": 123,
"max_amount": 123,
"bill_usage_difference": False,
"credits_expiration_in_days": 123,
"expire_credits_at_end_of_period": False
}
],
"name": "Initial term",
"type": "standard",
"status": "pending",
"order": 0,
"duration": {
"count": 1,
"period": "years"
},
"initial_billing_at": "2024-12-20T16:04:11Z",
"starts_at": "2024-12-20T16:04:11Z",
"ends_at": "2024-12-20T16:04:11Z",
"billing_cycle_alignment": "anniversary",
"do_not_invoice_phase": False,
"transition_calculation_method": "prorata",
"transition_invoicing_schedule": "immediately",
"coupons": [
{
"id": "<string>",
"duration_count": 123,
"expires_at": "2024-12-20T16:04:11Z",
"apply_at": "2024-12-20T16:04:11Z",
"product_ids": ["<string>"]
}
]
}
],
"name": "<string>",
"minimum_invoice_fee": 250,
"cancel_at": "2024-12-20T16:04:11Z",
"custom_properties": {},
"generate_document": True,
"document_name": "<string>",
"add_tax_to_document": True,
"generate_draft_invoices": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
currency: 'EUR',
country: null,
phases: [
{
activation_strategy: 'manual',
end_strategy: 'duration',
billing_date_setting: 'phase_start',
products: [
{
id: 'itm_FJKlqUb8COXw55',
name: 'Product name',
description: 'A description of the product.',
description_display_interval_dates: false,
payment_interval: {period: 'once'},
payment_schedule: 'start',
price: {type: 'fee', amount: 200},
prices: [
{
type: 'volume',
from: 0,
to: 20,
amount: 200,
unit_count: 1,
on_tier_incomplete: null
},
{
type: 'volume',
from: 20,
to: null,
amount: 150,
unit_count: 1,
on_tier_incomplete: null
}
],
count: 2,
unit_name: 'user',
min_committed_count: 2,
min_amount: 123,
max_amount: 123,
bill_usage_difference: false,
credits_expiration_in_days: 123,
expire_credits_at_end_of_period: false
}
],
name: 'Initial term',
type: 'standard',
status: 'pending',
order: 0,
duration: {count: 1, period: 'years'},
initial_billing_at: '2024-12-20T16:04:11Z',
starts_at: '2024-12-20T16:04:11Z',
ends_at: '2024-12-20T16:04:11Z',
billing_cycle_alignment: 'anniversary',
do_not_invoice_phase: false,
transition_calculation_method: 'prorata',
transition_invoicing_schedule: 'immediately',
coupons: [
{
id: '<string>',
duration_count: 123,
expires_at: '2024-12-20T16:04:11Z',
apply_at: '2024-12-20T16:04:11Z',
product_ids: ['<string>']
}
]
}
],
name: '<string>',
minimum_invoice_fee: 250,
cancel_at: '2024-12-20T16:04:11Z',
custom_properties: {},
generate_document: true,
document_name: '<string>',
add_tax_to_document: true,
generate_draft_invoices: true
})
};
fetch('https://api.hyperline.co/v1/subscriptions/templates/{templateId}/configurations/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.hyperline.co/v1/subscriptions/templates/{templateId}/configurations/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'currency' => 'EUR',
'country' => null,
'phases' => [
[
'activation_strategy' => 'manual',
'end_strategy' => 'duration',
'billing_date_setting' => 'phase_start',
'products' => [
[
'id' => 'itm_FJKlqUb8COXw55',
'name' => 'Product name',
'description' => 'A description of the product.',
'description_display_interval_dates' => false,
'payment_interval' => [
'period' => 'once'
],
'payment_schedule' => 'start',
'price' => [
'type' => 'fee',
'amount' => 200
],
'prices' => [
[
'type' => 'volume',
'from' => 0,
'to' => 20,
'amount' => 200,
'unit_count' => 1,
'on_tier_incomplete' => null
],
[
'type' => 'volume',
'from' => 20,
'to' => null,
'amount' => 150,
'unit_count' => 1,
'on_tier_incomplete' => null
]
],
'count' => 2,
'unit_name' => 'user',
'min_committed_count' => 2,
'min_amount' => 123,
'max_amount' => 123,
'bill_usage_difference' => false,
'credits_expiration_in_days' => 123,
'expire_credits_at_end_of_period' => false
]
],
'name' => 'Initial term',
'type' => 'standard',
'status' => 'pending',
'order' => 0,
'duration' => [
'count' => 1,
'period' => 'years'
],
'initial_billing_at' => '2024-12-20T16:04:11Z',
'starts_at' => '2024-12-20T16:04:11Z',
'ends_at' => '2024-12-20T16:04:11Z',
'billing_cycle_alignment' => 'anniversary',
'do_not_invoice_phase' => false,
'transition_calculation_method' => 'prorata',
'transition_invoicing_schedule' => 'immediately',
'coupons' => [
[
'id' => '<string>',
'duration_count' => 123,
'expires_at' => '2024-12-20T16:04:11Z',
'apply_at' => '2024-12-20T16:04:11Z',
'product_ids' => [
'<string>'
]
]
]
]
],
'name' => '<string>',
'minimum_invoice_fee' => 250,
'cancel_at' => '2024-12-20T16:04:11Z',
'custom_properties' => [
],
'generate_document' => true,
'document_name' => '<string>',
'add_tax_to_document' => true,
'generate_draft_invoices' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.hyperline.co/v1/subscriptions/templates/{templateId}/configurations/{id}"
payload := strings.NewReader("{\n \"currency\": \"EUR\",\n \"country\": null,\n \"phases\": [\n {\n \"activation_strategy\": \"manual\",\n \"end_strategy\": \"duration\",\n \"billing_date_setting\": \"phase_start\",\n \"products\": [\n {\n \"id\": \"itm_FJKlqUb8COXw55\",\n \"name\": \"Product name\",\n \"description\": \"A description of the product.\",\n \"description_display_interval_dates\": false,\n \"payment_interval\": {\n \"period\": \"once\"\n },\n \"payment_schedule\": \"start\",\n \"price\": {\n \"type\": \"fee\",\n \"amount\": 200\n },\n \"prices\": [\n {\n \"type\": \"volume\",\n \"from\": 0,\n \"to\": 20,\n \"amount\": 200,\n \"unit_count\": 1,\n \"on_tier_incomplete\": null\n },\n {\n \"type\": \"volume\",\n \"from\": 20,\n \"to\": null,\n \"amount\": 150,\n \"unit_count\": 1,\n \"on_tier_incomplete\": null\n }\n ],\n \"count\": 2,\n \"unit_name\": \"user\",\n \"min_committed_count\": 2,\n \"min_amount\": 123,\n \"max_amount\": 123,\n \"bill_usage_difference\": false,\n \"credits_expiration_in_days\": 123,\n \"expire_credits_at_end_of_period\": false\n }\n ],\n \"name\": \"Initial term\",\n \"type\": \"standard\",\n \"status\": \"pending\",\n \"order\": 0,\n \"duration\": {\n \"count\": 1,\n \"period\": \"years\"\n },\n \"initial_billing_at\": \"2024-12-20T16:04:11Z\",\n \"starts_at\": \"2024-12-20T16:04:11Z\",\n \"ends_at\": \"2024-12-20T16:04:11Z\",\n \"billing_cycle_alignment\": \"anniversary\",\n \"do_not_invoice_phase\": false,\n \"transition_calculation_method\": \"prorata\",\n \"transition_invoicing_schedule\": \"immediately\",\n \"coupons\": [\n {\n \"id\": \"<string>\",\n \"duration_count\": 123,\n \"expires_at\": \"2024-12-20T16:04:11Z\",\n \"apply_at\": \"2024-12-20T16:04:11Z\",\n \"product_ids\": [\n \"<string>\"\n ]\n }\n ]\n }\n ],\n \"name\": \"<string>\",\n \"minimum_invoice_fee\": 250,\n \"cancel_at\": \"2024-12-20T16:04:11Z\",\n \"custom_properties\": {},\n \"generate_document\": true,\n \"document_name\": \"<string>\",\n \"add_tax_to_document\": true,\n \"generate_draft_invoices\": true\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.hyperline.co/v1/subscriptions/templates/{templateId}/configurations/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"currency\": \"EUR\",\n \"country\": null,\n \"phases\": [\n {\n \"activation_strategy\": \"manual\",\n \"end_strategy\": \"duration\",\n \"billing_date_setting\": \"phase_start\",\n \"products\": [\n {\n \"id\": \"itm_FJKlqUb8COXw55\",\n \"name\": \"Product name\",\n \"description\": \"A description of the product.\",\n \"description_display_interval_dates\": false,\n \"payment_interval\": {\n \"period\": \"once\"\n },\n \"payment_schedule\": \"start\",\n \"price\": {\n \"type\": \"fee\",\n \"amount\": 200\n },\n \"prices\": [\n {\n \"type\": \"volume\",\n \"from\": 0,\n \"to\": 20,\n \"amount\": 200,\n \"unit_count\": 1,\n \"on_tier_incomplete\": null\n },\n {\n \"type\": \"volume\",\n \"from\": 20,\n \"to\": null,\n \"amount\": 150,\n \"unit_count\": 1,\n \"on_tier_incomplete\": null\n }\n ],\n \"count\": 2,\n \"unit_name\": \"user\",\n \"min_committed_count\": 2,\n \"min_amount\": 123,\n \"max_amount\": 123,\n \"bill_usage_difference\": false,\n \"credits_expiration_in_days\": 123,\n \"expire_credits_at_end_of_period\": false\n }\n ],\n \"name\": \"Initial term\",\n \"type\": \"standard\",\n \"status\": \"pending\",\n \"order\": 0,\n \"duration\": {\n \"count\": 1,\n \"period\": \"years\"\n },\n \"initial_billing_at\": \"2024-12-20T16:04:11Z\",\n \"starts_at\": \"2024-12-20T16:04:11Z\",\n \"ends_at\": \"2024-12-20T16:04:11Z\",\n \"billing_cycle_alignment\": \"anniversary\",\n \"do_not_invoice_phase\": false,\n \"transition_calculation_method\": \"prorata\",\n \"transition_invoicing_schedule\": \"immediately\",\n \"coupons\": [\n {\n \"id\": \"<string>\",\n \"duration_count\": 123,\n \"expires_at\": \"2024-12-20T16:04:11Z\",\n \"apply_at\": \"2024-12-20T16:04:11Z\",\n \"product_ids\": [\n \"<string>\"\n ]\n }\n ]\n }\n ],\n \"name\": \"<string>\",\n \"minimum_invoice_fee\": 250,\n \"cancel_at\": \"2024-12-20T16:04:11Z\",\n \"custom_properties\": {},\n \"generate_document\": true,\n \"document_name\": \"<string>\",\n \"add_tax_to_document\": true,\n \"generate_draft_invoices\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.hyperline.co/v1/subscriptions/templates/{templateId}/configurations/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"currency\": \"EUR\",\n \"country\": null,\n \"phases\": [\n {\n \"activation_strategy\": \"manual\",\n \"end_strategy\": \"duration\",\n \"billing_date_setting\": \"phase_start\",\n \"products\": [\n {\n \"id\": \"itm_FJKlqUb8COXw55\",\n \"name\": \"Product name\",\n \"description\": \"A description of the product.\",\n \"description_display_interval_dates\": false,\n \"payment_interval\": {\n \"period\": \"once\"\n },\n \"payment_schedule\": \"start\",\n \"price\": {\n \"type\": \"fee\",\n \"amount\": 200\n },\n \"prices\": [\n {\n \"type\": \"volume\",\n \"from\": 0,\n \"to\": 20,\n \"amount\": 200,\n \"unit_count\": 1,\n \"on_tier_incomplete\": null\n },\n {\n \"type\": \"volume\",\n \"from\": 20,\n \"to\": null,\n \"amount\": 150,\n \"unit_count\": 1,\n \"on_tier_incomplete\": null\n }\n ],\n \"count\": 2,\n \"unit_name\": \"user\",\n \"min_committed_count\": 2,\n \"min_amount\": 123,\n \"max_amount\": 123,\n \"bill_usage_difference\": false,\n \"credits_expiration_in_days\": 123,\n \"expire_credits_at_end_of_period\": false\n }\n ],\n \"name\": \"Initial term\",\n \"type\": \"standard\",\n \"status\": \"pending\",\n \"order\": 0,\n \"duration\": {\n \"count\": 1,\n \"period\": \"years\"\n },\n \"initial_billing_at\": \"2024-12-20T16:04:11Z\",\n \"starts_at\": \"2024-12-20T16:04:11Z\",\n \"ends_at\": \"2024-12-20T16:04:11Z\",\n \"billing_cycle_alignment\": \"anniversary\",\n \"do_not_invoice_phase\": false,\n \"transition_calculation_method\": \"prorata\",\n \"transition_invoicing_schedule\": \"immediately\",\n \"coupons\": [\n {\n \"id\": \"<string>\",\n \"duration_count\": 123,\n \"expires_at\": \"2024-12-20T16:04:11Z\",\n \"apply_at\": \"2024-12-20T16:04:11Z\",\n \"product_ids\": [\n \"<string>\"\n ]\n }\n ]\n }\n ],\n \"name\": \"<string>\",\n \"minimum_invoice_fee\": 250,\n \"cancel_at\": \"2024-12-20T16:04:11Z\",\n \"custom_properties\": {},\n \"generate_document\": true,\n \"document_name\": \"<string>\",\n \"add_tax_to_document\": true,\n \"generate_draft_invoices\": true\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>"
}Update subscription template configuration
Replace an existing configuration for a subscription template.
curl --request PUT \
--url https://api.hyperline.co/v1/subscriptions/templates/{templateId}/configurations/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"currency": "EUR",
"country": null,
"phases": [
{
"activation_strategy": "manual",
"end_strategy": "duration",
"billing_date_setting": "phase_start",
"products": [
{
"id": "itm_FJKlqUb8COXw55",
"name": "Product name",
"description": "A description of the product.",
"description_display_interval_dates": false,
"payment_interval": {
"period": "once"
},
"payment_schedule": "start",
"price": {
"type": "fee",
"amount": 200
},
"prices": [
{
"type": "volume",
"from": 0,
"to": 20,
"amount": 200,
"unit_count": 1,
"on_tier_incomplete": null
},
{
"type": "volume",
"from": 20,
"to": null,
"amount": 150,
"unit_count": 1,
"on_tier_incomplete": null
}
],
"count": 2,
"unit_name": "user",
"min_committed_count": 2,
"min_amount": 123,
"max_amount": 123,
"bill_usage_difference": false,
"credits_expiration_in_days": 123,
"expire_credits_at_end_of_period": false
}
],
"name": "Initial term",
"type": "standard",
"status": "pending",
"order": 0,
"duration": {
"count": 1,
"period": "years"
},
"initial_billing_at": "2024-12-20T16:04:11Z",
"starts_at": "2024-12-20T16:04:11Z",
"ends_at": "2024-12-20T16:04:11Z",
"billing_cycle_alignment": "anniversary",
"do_not_invoice_phase": false,
"transition_calculation_method": "prorata",
"transition_invoicing_schedule": "immediately",
"coupons": [
{
"id": "<string>",
"duration_count": 123,
"expires_at": "2024-12-20T16:04:11Z",
"apply_at": "2024-12-20T16:04:11Z",
"product_ids": [
"<string>"
]
}
]
}
],
"name": "<string>",
"minimum_invoice_fee": 250,
"cancel_at": "2024-12-20T16:04:11Z",
"custom_properties": {},
"generate_document": true,
"document_name": "<string>",
"add_tax_to_document": true,
"generate_draft_invoices": true
}
'import requests
url = "https://api.hyperline.co/v1/subscriptions/templates/{templateId}/configurations/{id}"
payload = {
"currency": "EUR",
"country": None,
"phases": [
{
"activation_strategy": "manual",
"end_strategy": "duration",
"billing_date_setting": "phase_start",
"products": [
{
"id": "itm_FJKlqUb8COXw55",
"name": "Product name",
"description": "A description of the product.",
"description_display_interval_dates": False,
"payment_interval": { "period": "once" },
"payment_schedule": "start",
"price": {
"type": "fee",
"amount": 200
},
"prices": [
{
"type": "volume",
"from": 0,
"to": 20,
"amount": 200,
"unit_count": 1,
"on_tier_incomplete": None
},
{
"type": "volume",
"from": 20,
"to": None,
"amount": 150,
"unit_count": 1,
"on_tier_incomplete": None
}
],
"count": 2,
"unit_name": "user",
"min_committed_count": 2,
"min_amount": 123,
"max_amount": 123,
"bill_usage_difference": False,
"credits_expiration_in_days": 123,
"expire_credits_at_end_of_period": False
}
],
"name": "Initial term",
"type": "standard",
"status": "pending",
"order": 0,
"duration": {
"count": 1,
"period": "years"
},
"initial_billing_at": "2024-12-20T16:04:11Z",
"starts_at": "2024-12-20T16:04:11Z",
"ends_at": "2024-12-20T16:04:11Z",
"billing_cycle_alignment": "anniversary",
"do_not_invoice_phase": False,
"transition_calculation_method": "prorata",
"transition_invoicing_schedule": "immediately",
"coupons": [
{
"id": "<string>",
"duration_count": 123,
"expires_at": "2024-12-20T16:04:11Z",
"apply_at": "2024-12-20T16:04:11Z",
"product_ids": ["<string>"]
}
]
}
],
"name": "<string>",
"minimum_invoice_fee": 250,
"cancel_at": "2024-12-20T16:04:11Z",
"custom_properties": {},
"generate_document": True,
"document_name": "<string>",
"add_tax_to_document": True,
"generate_draft_invoices": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
currency: 'EUR',
country: null,
phases: [
{
activation_strategy: 'manual',
end_strategy: 'duration',
billing_date_setting: 'phase_start',
products: [
{
id: 'itm_FJKlqUb8COXw55',
name: 'Product name',
description: 'A description of the product.',
description_display_interval_dates: false,
payment_interval: {period: 'once'},
payment_schedule: 'start',
price: {type: 'fee', amount: 200},
prices: [
{
type: 'volume',
from: 0,
to: 20,
amount: 200,
unit_count: 1,
on_tier_incomplete: null
},
{
type: 'volume',
from: 20,
to: null,
amount: 150,
unit_count: 1,
on_tier_incomplete: null
}
],
count: 2,
unit_name: 'user',
min_committed_count: 2,
min_amount: 123,
max_amount: 123,
bill_usage_difference: false,
credits_expiration_in_days: 123,
expire_credits_at_end_of_period: false
}
],
name: 'Initial term',
type: 'standard',
status: 'pending',
order: 0,
duration: {count: 1, period: 'years'},
initial_billing_at: '2024-12-20T16:04:11Z',
starts_at: '2024-12-20T16:04:11Z',
ends_at: '2024-12-20T16:04:11Z',
billing_cycle_alignment: 'anniversary',
do_not_invoice_phase: false,
transition_calculation_method: 'prorata',
transition_invoicing_schedule: 'immediately',
coupons: [
{
id: '<string>',
duration_count: 123,
expires_at: '2024-12-20T16:04:11Z',
apply_at: '2024-12-20T16:04:11Z',
product_ids: ['<string>']
}
]
}
],
name: '<string>',
minimum_invoice_fee: 250,
cancel_at: '2024-12-20T16:04:11Z',
custom_properties: {},
generate_document: true,
document_name: '<string>',
add_tax_to_document: true,
generate_draft_invoices: true
})
};
fetch('https://api.hyperline.co/v1/subscriptions/templates/{templateId}/configurations/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.hyperline.co/v1/subscriptions/templates/{templateId}/configurations/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'currency' => 'EUR',
'country' => null,
'phases' => [
[
'activation_strategy' => 'manual',
'end_strategy' => 'duration',
'billing_date_setting' => 'phase_start',
'products' => [
[
'id' => 'itm_FJKlqUb8COXw55',
'name' => 'Product name',
'description' => 'A description of the product.',
'description_display_interval_dates' => false,
'payment_interval' => [
'period' => 'once'
],
'payment_schedule' => 'start',
'price' => [
'type' => 'fee',
'amount' => 200
],
'prices' => [
[
'type' => 'volume',
'from' => 0,
'to' => 20,
'amount' => 200,
'unit_count' => 1,
'on_tier_incomplete' => null
],
[
'type' => 'volume',
'from' => 20,
'to' => null,
'amount' => 150,
'unit_count' => 1,
'on_tier_incomplete' => null
]
],
'count' => 2,
'unit_name' => 'user',
'min_committed_count' => 2,
'min_amount' => 123,
'max_amount' => 123,
'bill_usage_difference' => false,
'credits_expiration_in_days' => 123,
'expire_credits_at_end_of_period' => false
]
],
'name' => 'Initial term',
'type' => 'standard',
'status' => 'pending',
'order' => 0,
'duration' => [
'count' => 1,
'period' => 'years'
],
'initial_billing_at' => '2024-12-20T16:04:11Z',
'starts_at' => '2024-12-20T16:04:11Z',
'ends_at' => '2024-12-20T16:04:11Z',
'billing_cycle_alignment' => 'anniversary',
'do_not_invoice_phase' => false,
'transition_calculation_method' => 'prorata',
'transition_invoicing_schedule' => 'immediately',
'coupons' => [
[
'id' => '<string>',
'duration_count' => 123,
'expires_at' => '2024-12-20T16:04:11Z',
'apply_at' => '2024-12-20T16:04:11Z',
'product_ids' => [
'<string>'
]
]
]
]
],
'name' => '<string>',
'minimum_invoice_fee' => 250,
'cancel_at' => '2024-12-20T16:04:11Z',
'custom_properties' => [
],
'generate_document' => true,
'document_name' => '<string>',
'add_tax_to_document' => true,
'generate_draft_invoices' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.hyperline.co/v1/subscriptions/templates/{templateId}/configurations/{id}"
payload := strings.NewReader("{\n \"currency\": \"EUR\",\n \"country\": null,\n \"phases\": [\n {\n \"activation_strategy\": \"manual\",\n \"end_strategy\": \"duration\",\n \"billing_date_setting\": \"phase_start\",\n \"products\": [\n {\n \"id\": \"itm_FJKlqUb8COXw55\",\n \"name\": \"Product name\",\n \"description\": \"A description of the product.\",\n \"description_display_interval_dates\": false,\n \"payment_interval\": {\n \"period\": \"once\"\n },\n \"payment_schedule\": \"start\",\n \"price\": {\n \"type\": \"fee\",\n \"amount\": 200\n },\n \"prices\": [\n {\n \"type\": \"volume\",\n \"from\": 0,\n \"to\": 20,\n \"amount\": 200,\n \"unit_count\": 1,\n \"on_tier_incomplete\": null\n },\n {\n \"type\": \"volume\",\n \"from\": 20,\n \"to\": null,\n \"amount\": 150,\n \"unit_count\": 1,\n \"on_tier_incomplete\": null\n }\n ],\n \"count\": 2,\n \"unit_name\": \"user\",\n \"min_committed_count\": 2,\n \"min_amount\": 123,\n \"max_amount\": 123,\n \"bill_usage_difference\": false,\n \"credits_expiration_in_days\": 123,\n \"expire_credits_at_end_of_period\": false\n }\n ],\n \"name\": \"Initial term\",\n \"type\": \"standard\",\n \"status\": \"pending\",\n \"order\": 0,\n \"duration\": {\n \"count\": 1,\n \"period\": \"years\"\n },\n \"initial_billing_at\": \"2024-12-20T16:04:11Z\",\n \"starts_at\": \"2024-12-20T16:04:11Z\",\n \"ends_at\": \"2024-12-20T16:04:11Z\",\n \"billing_cycle_alignment\": \"anniversary\",\n \"do_not_invoice_phase\": false,\n \"transition_calculation_method\": \"prorata\",\n \"transition_invoicing_schedule\": \"immediately\",\n \"coupons\": [\n {\n \"id\": \"<string>\",\n \"duration_count\": 123,\n \"expires_at\": \"2024-12-20T16:04:11Z\",\n \"apply_at\": \"2024-12-20T16:04:11Z\",\n \"product_ids\": [\n \"<string>\"\n ]\n }\n ]\n }\n ],\n \"name\": \"<string>\",\n \"minimum_invoice_fee\": 250,\n \"cancel_at\": \"2024-12-20T16:04:11Z\",\n \"custom_properties\": {},\n \"generate_document\": true,\n \"document_name\": \"<string>\",\n \"add_tax_to_document\": true,\n \"generate_draft_invoices\": true\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.hyperline.co/v1/subscriptions/templates/{templateId}/configurations/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"currency\": \"EUR\",\n \"country\": null,\n \"phases\": [\n {\n \"activation_strategy\": \"manual\",\n \"end_strategy\": \"duration\",\n \"billing_date_setting\": \"phase_start\",\n \"products\": [\n {\n \"id\": \"itm_FJKlqUb8COXw55\",\n \"name\": \"Product name\",\n \"description\": \"A description of the product.\",\n \"description_display_interval_dates\": false,\n \"payment_interval\": {\n \"period\": \"once\"\n },\n \"payment_schedule\": \"start\",\n \"price\": {\n \"type\": \"fee\",\n \"amount\": 200\n },\n \"prices\": [\n {\n \"type\": \"volume\",\n \"from\": 0,\n \"to\": 20,\n \"amount\": 200,\n \"unit_count\": 1,\n \"on_tier_incomplete\": null\n },\n {\n \"type\": \"volume\",\n \"from\": 20,\n \"to\": null,\n \"amount\": 150,\n \"unit_count\": 1,\n \"on_tier_incomplete\": null\n }\n ],\n \"count\": 2,\n \"unit_name\": \"user\",\n \"min_committed_count\": 2,\n \"min_amount\": 123,\n \"max_amount\": 123,\n \"bill_usage_difference\": false,\n \"credits_expiration_in_days\": 123,\n \"expire_credits_at_end_of_period\": false\n }\n ],\n \"name\": \"Initial term\",\n \"type\": \"standard\",\n \"status\": \"pending\",\n \"order\": 0,\n \"duration\": {\n \"count\": 1,\n \"period\": \"years\"\n },\n \"initial_billing_at\": \"2024-12-20T16:04:11Z\",\n \"starts_at\": \"2024-12-20T16:04:11Z\",\n \"ends_at\": \"2024-12-20T16:04:11Z\",\n \"billing_cycle_alignment\": \"anniversary\",\n \"do_not_invoice_phase\": false,\n \"transition_calculation_method\": \"prorata\",\n \"transition_invoicing_schedule\": \"immediately\",\n \"coupons\": [\n {\n \"id\": \"<string>\",\n \"duration_count\": 123,\n \"expires_at\": \"2024-12-20T16:04:11Z\",\n \"apply_at\": \"2024-12-20T16:04:11Z\",\n \"product_ids\": [\n \"<string>\"\n ]\n }\n ]\n }\n ],\n \"name\": \"<string>\",\n \"minimum_invoice_fee\": 250,\n \"cancel_at\": \"2024-12-20T16:04:11Z\",\n \"custom_properties\": {},\n \"generate_document\": true,\n \"document_name\": \"<string>\",\n \"add_tax_to_document\": true,\n \"generate_draft_invoices\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.hyperline.co/v1/subscriptions/templates/{templateId}/configurations/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"currency\": \"EUR\",\n \"country\": null,\n \"phases\": [\n {\n \"activation_strategy\": \"manual\",\n \"end_strategy\": \"duration\",\n \"billing_date_setting\": \"phase_start\",\n \"products\": [\n {\n \"id\": \"itm_FJKlqUb8COXw55\",\n \"name\": \"Product name\",\n \"description\": \"A description of the product.\",\n \"description_display_interval_dates\": false,\n \"payment_interval\": {\n \"period\": \"once\"\n },\n \"payment_schedule\": \"start\",\n \"price\": {\n \"type\": \"fee\",\n \"amount\": 200\n },\n \"prices\": [\n {\n \"type\": \"volume\",\n \"from\": 0,\n \"to\": 20,\n \"amount\": 200,\n \"unit_count\": 1,\n \"on_tier_incomplete\": null\n },\n {\n \"type\": \"volume\",\n \"from\": 20,\n \"to\": null,\n \"amount\": 150,\n \"unit_count\": 1,\n \"on_tier_incomplete\": null\n }\n ],\n \"count\": 2,\n \"unit_name\": \"user\",\n \"min_committed_count\": 2,\n \"min_amount\": 123,\n \"max_amount\": 123,\n \"bill_usage_difference\": false,\n \"credits_expiration_in_days\": 123,\n \"expire_credits_at_end_of_period\": false\n }\n ],\n \"name\": \"Initial term\",\n \"type\": \"standard\",\n \"status\": \"pending\",\n \"order\": 0,\n \"duration\": {\n \"count\": 1,\n \"period\": \"years\"\n },\n \"initial_billing_at\": \"2024-12-20T16:04:11Z\",\n \"starts_at\": \"2024-12-20T16:04:11Z\",\n \"ends_at\": \"2024-12-20T16:04:11Z\",\n \"billing_cycle_alignment\": \"anniversary\",\n \"do_not_invoice_phase\": false,\n \"transition_calculation_method\": \"prorata\",\n \"transition_invoicing_schedule\": \"immediately\",\n \"coupons\": [\n {\n \"id\": \"<string>\",\n \"duration_count\": 123,\n \"expires_at\": \"2024-12-20T16:04:11Z\",\n \"apply_at\": \"2024-12-20T16:04:11Z\",\n \"product_ids\": [\n \"<string>\"\n ]\n }\n ]\n }\n ],\n \"name\": \"<string>\",\n \"minimum_invoice_fee\": 250,\n \"cancel_at\": \"2024-12-20T16:04:11Z\",\n \"custom_properties\": {},\n \"generate_document\": true,\n \"document_name\": \"<string>\",\n \"add_tax_to_document\": true,\n \"generate_draft_invoices\": true\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
Subscription template currency.
EUR, AED, AFN, XCD, ALL, AMD, AOA, ARS, USD, AUD, AWG, AZN, BAM, BBD, BDT, BGN, BHD, BIF, XOF, BMD, BND, BOB, BRL, BSD, BTN, NOK, BWP, BYR, BZD, CAD, CDF, XAF, CHF, NZD, CLP, CNY, COP, CRC, CUP, CVE, ANG, CZK, DJF, DKK, DOP, DZD, EGP, MAD, ERN, ETB, FJD, FKP, GBP, GEL, GHS, GIP, GMD, GNF, GTQ, GYD, HKD, HNL, HRK, HTG, HUF, IDR, ILS, INR, IQD, IRR, ISK, JMD, JOD, JPY, KES, KGS, KHR, KMF, KPW, KRW, KWD, KYD, KZT, LAK, LBP, LKR, LRD, LSL, LYD, MDL, MGA, MKD, MMK, MNT, MOP, MRO, MUR, MVR, MWK, MXN, MYR, MZN, NAD, XPF, NGN, NIO, NPR, OMR, PAB, PEN, PGK, PHP, PKR, PLN, PYG, QAR, RON, RSD, RUB, RWF, SAR, SBD, SCR, SDG, SEK, SGD, SHP, SLL, SOS, SRD, SSP, STD, SYP, SZL, THB, TJS, TMT, TND, TOP, TRY, TTD, TWD, TZS, UAH, UGX, UYU, UZS, VEF, VND, VUV, WST, YER, ZAR, ZMW, ZWL "EUR"
Subscription template country.
AD, AE, AF, AG, AI, AL, AM, AO, AQ, AR, AS, AT, AU, AW, AX, AZ, BA, BB, BD, BE, BG, BH, BI, BJ, BL, BM, BN, BO, BQ, BR, BS, BT, BF, BV, BW, BY, BZ, CA, CC, CD, CF, CG, CH, CI, CK, CL, CM, CN, CO, CR, CU, CV, CW, CX, CY, CZ, DE, DJ, DK, DM, DO, DZ, EC, EE, EG, EH, ER, ES, ET, FI, FJ, FK, FM, FO, FR, GA, GB, GD, GE, GF, GG, GH, GI, GL, GM, GN, GP, GQ, GR, GS, GT, GU, GW, GY, HK, HM, HN, HR, HT, HU, IC, ID, IE, IL, IM, IN, IO, IQ, IR, IS, IT, JE, JM, JO, JP, KE, KG, KH, KI, KM, KN, KP, KR, KW, KY, KZ, LA, LB, LC, LI, LK, LR, LS, LT, LU, LV, LY, MA, MC, MD, ME, MF, MG, MH, MK, ML, MM, MN, MO, MP, MQ, MR, MS, MT, MU, MV, MW, MX, MY, MZ, NA, NC, NE, NF, NG, NI, NL, NO, NP, NR, NU, NZ, OM, PA, PE, PF, PG, PH, PK, PL, PM, PN, PR, PS, PT, PT-20, PT-30, PW, PY, QA, RE, RO, RS, RU, RW, SA, SB, SC, SD, SE, SG, SH, SI, SJ, SK, SL, SM, SN, SO, SR, SS, ST, SV, SX, SY, SZ, TC, TD, TF, TG, TH, TJ, TK, TL, TM, TN, TO, TR, TT, TV, TW, TZ, UA, UG, UM, US, UY, UZ, VA, VC, VE, VG, VI, VN, VU, WF, WS, XK, YE, YT, ZA, ZM, ZW null
Phases of the subscription.
Show child attributes
Show child attributes
Subscription custom name.
Minimum fee applied to each invoice outside of one time payments.
250
Strategy used to cancel the subscription. If not specified do_nothing is used.
charge_prorata: Will charge the customer the unpaid amount for the prorated period up to the end of the current period.charge_custom: Will charge the customer a custom amount.refund_prorata: Will refund to the customer the overpaid subscription amount using prorated calculations on the cancellation date.refund_custom: Will refund to the customer a custom amount.end_of_period: Will cancel the subscription at the end date of the current billing period.do_nothing: Will only cease the subscription without any additional actions.
refund_prorata, refund_custom, charge_prorata, charge_custom, end_of_period, do_nothing A list of key value with the slug of the custom property as the key and the custom property value as value.
Show child attributes
Show child attributes
Generate non-legal documents instead of invoices.
If generate_document is turned on, allows you to give a name to your document.
If generate_document is turned on, will add taxes to document.
Generate draft invoices for the subscription. Each invoice will need to be reviewed and validated manually before being sent
Contract terms linked to the subscription.
Show child attributes
Show child attributes
Response
Was this page helpful?

